<div class = "main-view">
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">抽奖活动管理</strong></div>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label>抽奖活动名称</label> <input type="text" class="am-form-field">

        </div>
        <!--<div class="am-form-group">-->
            <!--<label>菜单类型</label> <input type="password" class="am-form-field">-->
        <!--</div>-->
        <button type="submit" class="am-btn am-btn-primary">搜索</button>
    </form>
    <br>
    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-add', width: 800, height: 600}"><span class="am-icon-plus"></span>添加抽奖活动</button>
        <button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>
    </div>
    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <th>序号</th>
                    <th>活动名称</th>
                    <th>摇奖次数(次/人)</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="result in resultList">
                    <td class="table-check"><input type="checkbox" class = "item-check"></td>
                    <td>{{result.id}}</td>
                    <td>{{result.activity_name}}</td>
                    <td>{{result.lottery_limit}}</td>
                    <td>{{result.begin_time|date:"yyyy-MM-dd HH:mm"}}</td>
                    <td>{{result.end_time|date:"yyyy-MM-dd HH:mm"}}</td>
                    <!--<th><span ng-show="result.is_publish==0">否</span><span ng-show="result.is_publish==1">是</span></th>-->
                    <td>{{result.create_time|date:"yyyy-MM-dd HH:mm"}}</td>
                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <!--<button type="button" class="btn-primary btn-sm" ng-click="getCommunitys(result.id)" >查看所属小区</button>-->
                                <button type="button" class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="editPrize(result.id)" >设置奖品</button>
                                <button type="button" class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="getAwardList(result.id)" >查看中奖名单</button>
                                <button type="button" class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="update(result.id)" >修改</button>
                                <!--<button type="button" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" ng-click="delete(result.id)" >删除</button>-->
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>

    <!--新增框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">新增抽奖活动
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area text-left">
                <form>
                    <br>
                    <label>抽奖活动名称:</label><input class="modal-input" ng-model="addData.activityName" required tabindex="5">
                    <br>
                    <label>参与活动小区:</label><br>
                    <div class = "city-cascading" style = "display: inline-block;" id = "cascad-search-add"></div>
                    <!--<div><label>小区名称</label><input type="text" class = "modal-input" ng-model="addData.communityName"></div>-->
                    <input type="text" class="modal-input" ng-model="cname" id = "cname_filter" ng-change="cnameFilter(cname)" placeholder="搜索小区" style = "width: 200px;">
                    <table id="manyCommunity" style="width:500px;" border="0" >
                        <tr align="center">
                            <td >
                                <select id="communities_select" multiple="multiple" ng-model="oneCommunity"
                                        style="width: 200px;height:300px;">
                                    <option ng-repeat="community in communityList" value="{{community.objId}}">{{community.communityName}}</option>
                                </select>
                            </td>
                            <td >
                                <input type="button" value=" >> " id="addAllCommunity" ng-click="addAllCommunity()" /><br /><br />
                                <input type="button" value=" > " id="addCommunity" ng-click="addCommunity()" /><br /><br />
                                <input type="button" value=" < " id="removeCommunity" ng-click="removeCommunity()"/><br /><br />
                                <input type="button" value=" << " id="removeAllCommunity" ng-click="removeAllCommunity()"/>
                            </td>
                            <td>
                                <select id="selCommunitys" multiple="multiple"
                                        style="width: 200px;height:300px;" ng-model="selCommunitys">

                                </select>
                            </td>

                        </tr>
                    </table>
                    <br />
                    <label class="control-label">摇奖次数(次/人)：</label>
                    <input class="form-control" ng-model="addData.limitCount" required tabindex="5">
                    <br />
                    <label class="control-label">活动描述：</label><br />
                    <textarea style="width:600px;height:200px;" ng-model="addData.activityDesc" required tabindex="5"></textarea>
                    <br /><br />
                    <label class="control-label">规则描述：</label><br />
                    <textarea style="width:600px;height:200px;" ng-model="addData.ruleDesc" required tabindex="5"></textarea>
                    <br /><br />
                    <div>
                        <label>开始时间</label><input type="datetime-local" ng-model="addData.dateBegin">
                        <label>结束时间</label><input type="datetime-local" ng-model="addData.dateEnd">
                    </div>
                </form>
            </div>
            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="add(addData)" data-target = "cascad-search-add">保存</button>
            </div>
        </div>
    </div>
</div>

